const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const Blog = new Schema(
  {
    title: {
      type: "string"
    },
    content: {
      type: "string"
    },
    tags: ["string"],
    author: {
      type: Schema.ObjectId,
      ref: "auth"
    },
    lookCount: {
      type: "number",
      default: 0
    }
  },
  {
    timestamps: {
      createdAt: "created_at",
      updatedAt: "updated_at"
    }
  }
);

mongoose.model("blog", Blog);
